from django.urls import path
from .views import (
    EnrollmentView,
    StudentEnrollmentListView,
    TeacherEnrollmentListView,
    AdminEnrollmentListView,
    EnrollmentDetailView,
    GradeEntryView,
    BatchGradeEntryView,
    MarkCompletedView,
    BatchMarkCompletedView,
    AdminForceDropEnrollmentView,
    BatchForceDropView,
    AdminResetGradeView,
    EnrollmentStatisticsView,
    EnrollmentExportView,
    BatchExportView,
    CourseEnrollmentStatusView,
    StudentCourseStatusView
)

app_name = 'enrollments'

urlpatterns = [
    # 基础选课操作
    path('enrollment/', EnrollmentView.as_view(), name='enrollment'),

    # 不同角色的选课列表查询
    path('my-enrollments/', StudentEnrollmentListView.as_view(), name='student_enrollments'),
    path('teacher-enrollments/', TeacherEnrollmentListView.as_view(), name='teacher_enrollments'),
    path('all-enrollments/', AdminEnrollmentListView.as_view(), name='admin_enrollments'),

    # 选课详情
    path('enrollment-detail/<int:enrollment_id>/', EnrollmentDetailView.as_view(), name='enrollment_detail'),

    # 成绩管理
    path('grade-entry/<int:enrollment_id>/', GradeEntryView.as_view(), name='grade_entry'),
    path('batch-grade-entry/', BatchGradeEntryView.as_view(), name='batch_grade_entry'),

    # 课程完成标记
    path('mark-completed/<int:enrollment_id>/', MarkCompletedView.as_view(), name='mark_completed'),
    path('batch-mark-completed/', BatchMarkCompletedView.as_view(), name='batch_mark_completed'),

    # 管理员专用操作
    path('admin/force-drop-enrollment/<int:enrollment_id>/',
         AdminForceDropEnrollmentView.as_view(), name='admin_force_drop'),
    path('admin/batch-force-drop/',
         BatchForceDropView.as_view(), name='admin_batch_force_drop'),
    path('admin/reset-grade/<int:enrollment_id>/',
         AdminResetGradeView.as_view(), name='admin_reset_grade'),

    # 统计和报表
    path('enrollment-statistics/',
         EnrollmentStatisticsView.as_view(), name='enrollment_statistics'),

    # 数据导出
    path('teacher-enrollments/export/',
         EnrollmentExportView.as_view(), name='teacher_export'),
    path('all-enrollments/export/',
         EnrollmentExportView.as_view(), name='admin_export'),
    path('enrollments/batch-export/',
         BatchExportView.as_view(), name='batch_export'),

    # 选课状态查询
    path('courses/<int:course_id>/enrollment-status/',
         CourseEnrollmentStatusView.as_view(), name='course_enrollment_status'),
    path('student-course-status/',
         StudentCourseStatusView.as_view(), name='student_course_status'),
]